home *** CD-ROM | disk | FTP | other *** search
- import java.awt.image.MemoryImageSource;
-
- public class UnrollTransition extends BannerTransition {
- static int[] fillPixels = new int[]{-1, -16777216, -16777216, -1};
- int[] unrollAmount = null;
- int location;
-
- public UnrollTransition() {
- super.numOfFrames = 9;
- }
-
- public void finishInit() {
- float unrollIncrement = (float)super.imageHeight / (float)(super.numOfFrames + 1) / ((float)(super.numOfFrames + 2) / 2.0F);
- int total = 0;
- this.unrollAmount = new int[super.numOfFrames + 1];
-
- for(int u = 0; u <= super.numOfFrames; ++u) {
- this.unrollAmount[u] = (int)(unrollIncrement * (float)(super.numOfFrames - u + 1));
- total += this.unrollAmount[u];
- }
-
- if (total < 0) {
- int var10002 = this.unrollAmount[0]--;
- }
-
- super.delay = 220;
- this.location = super.pixelsPerImage;
- System.arraycopy(super.owner.banners[super.owner.currentBanner].imagePixels, 0, super.workPixels, 0, super.pixelsPerImage);
-
- for(int f = 0; f < super.numOfFrames; ++f) {
- this.location -= this.unrollAmount[f] * super.imageWidth;
-
- try {
- Thread.sleep(150L);
- } catch (InterruptedException var8) {
- }
-
- this.Unroll(f);
-
- try {
- Thread.sleep(100L);
- } catch (InterruptedException var7) {
- }
-
- super.frames[f] = super.owner.createImage(new MemoryImageSource(super.imageWidth, super.imageHeight, super.workPixels, 0, super.imageWidth));
- super.owner.prepareImage(super.frames[f], super.owner);
- System.arraycopy(super.owner.banners[super.owner.nextBanner].imagePixels, this.location, super.workPixels, this.location, this.unrollAmount[f] * super.imageWidth);
- }
-
- super.workPixels = null;
- }
-
- void Unroll(int f) {
- int yFlip = super.imageWidth;
- int[] offset = new int[this.unrollAmount[f]];
-
- for(int o = 0; o < this.unrollAmount[f]; ++o) {
- offset[o] = 4;
- }
-
- offset[0] = 2;
- if (this.unrollAmount[f] > 1) {
- offset[1] = 3;
- }
-
- if (this.unrollAmount[f] > 2) {
- offset[this.unrollAmount[f] - 1] = 2;
- }
-
- if (this.unrollAmount[f] > 3) {
- offset[this.unrollAmount[f] - 2] = 3;
- }
-
- int offset_index = 0;
-
- for(int p = this.location; p < this.location + this.unrollAmount[f] * super.imageWidth; p += super.imageWidth) {
- try {
- System.arraycopy(super.owner.banners[super.owner.nextBanner].imagePixels, p - yFlip + offset[offset_index], super.workPixels, p, super.imageWidth - offset[offset_index]);
- System.arraycopy(fillPixels, 0, super.workPixels, p + super.imageWidth - offset[offset_index], offset[offset_index]);
- ++offset_index;
- yFlip += super.imageWidth + super.imageWidth;
- } catch (ArrayIndexOutOfBoundsException var8) {
- break;
- }
- }
-
- for(int x = this.location + super.imageWidth - 1; x > this.location; --x) {
- int[] var10000 = super.workPixels;
- var10000[x] |= -5592406;
- var10000 = super.workPixels;
- int var10001 = x + this.unrollAmount[f];
- var10000[var10001] &= -11184811;
- }
-
- }
- }
-